var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/functionalComponent/table/base/common.ts
var common_exports = {};
__export(common_exports, {
  AttachmentTemp: () => AttachmentTemp,
  CellTypeEnum: () => CellTypeEnum,
  DsContext: () => DsContext,
  IS_EXPANDED: () => IS_EXPANDED,
  IS_GROUP: () => IS_GROUP,
  TableContext: () => TableContext,
  TableSelectionModel: () => TableSelectionModel,
  UpdateFlagEnum: () => UpdateFlagEnum,
  areEqual: () => areEqual,
  cancelTimeout: () => cancelTimeout,
  requestTimeout: () => requestTimeout,
  shallowDiffers: () => shallowDiffers
});
module.exports = __toCommonJS(common_exports);
var import_react = require("react");
var hasNativePerformanceNow = typeof performance === "object" && typeof performance.now === "function";
var now = hasNativePerformanceNow ? () => performance.now() : () => Date.now();
function cancelTimeout(timeoutID) {
  cancelAnimationFrame(timeoutID.id);
}
function requestTimeout(callback, delay) {
  const start = now();
  function tick() {
    if (now() - start >= delay) {
      callback.call(null);
    } else {
      timeoutID.id = requestAnimationFrame(tick);
    }
  }
  const timeoutID = {
    id: requestAnimationFrame(tick)
  };
  return timeoutID;
}
function shallowDiffers(prev, next, exceptKey = "") {
  for (let attribute in prev) {
    if (attribute !== exceptKey && !next.hasOwnProperty(attribute)) {
      return true;
    }
  }
  for (let attribute in next) {
    if (attribute !== exceptKey && prev[attribute] !== next[attribute]) {
      return true;
    }
  }
  return false;
}
function areEqual(prevProps, nextProps) {
  return !shallowDiffers(prevProps.style || {}, nextProps.style || {}) && !shallowDiffers(prevProps, nextProps, "style");
}
var CellTypeEnum = /* @__PURE__ */ ((CellTypeEnum2) => {
  CellTypeEnum2[CellTypeEnum2["BodyCell"] = 0] = "BodyCell";
  CellTypeEnum2[CellTypeEnum2["MergeCell"] = 1] = "MergeCell";
  CellTypeEnum2[CellTypeEnum2["AggregateCell"] = 2] = "AggregateCell";
  CellTypeEnum2[CellTypeEnum2["FixedBodyCell"] = 3] = "FixedBodyCell";
  CellTypeEnum2[CellTypeEnum2["ExpandRowCell"] = 4] = "ExpandRowCell";
  CellTypeEnum2[CellTypeEnum2["GroupRowCell"] = 5] = "GroupRowCell";
  CellTypeEnum2[CellTypeEnum2["ZwCell"] = 6] = "ZwCell";
  return CellTypeEnum2;
})(CellTypeEnum || {});
var UpdateFlagEnum = /* @__PURE__ */ ((UpdateFlagEnum2) => {
  UpdateFlagEnum2[UpdateFlagEnum2["None"] = 0] = "None";
  UpdateFlagEnum2[UpdateFlagEnum2["ColumnChecked"] = 1] = "ColumnChecked";
  UpdateFlagEnum2[UpdateFlagEnum2["RowUpdate"] = 2] = "RowUpdate";
  UpdateFlagEnum2[UpdateFlagEnum2["UserUpdate"] = 3] = "UserUpdate";
  UpdateFlagEnum2[UpdateFlagEnum2["ForceUpdate"] = 4] = "ForceUpdate";
  return UpdateFlagEnum2;
})(UpdateFlagEnum || {});
var TableSelectionModel = /* @__PURE__ */ ((TableSelectionModel2) => {
  TableSelectionModel2[TableSelectionModel2["ROW"] = 0] = "ROW";
  TableSelectionModel2[TableSelectionModel2["CHECKBOX"] = 1] = "CHECKBOX";
  TableSelectionModel2[TableSelectionModel2["MULTIPLE_INTERVAL"] = 2] = "MULTIPLE_INTERVAL";
  return TableSelectionModel2;
})(TableSelectionModel || {});
var AttachmentTemp = Symbol("__attachment_temp__");
var IS_GROUP = Symbol("isGroup");
var IS_EXPANDED = Symbol("isExpanded");
var TableContext = (0, import_react.createContext)({
  table: {},
  columns: []
});
var DsContext = (0, import_react.createContext)([]);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  AttachmentTemp,
  CellTypeEnum,
  DsContext,
  IS_EXPANDED,
  IS_GROUP,
  TableContext,
  TableSelectionModel,
  UpdateFlagEnum,
  areEqual,
  cancelTimeout,
  requestTimeout,
  shallowDiffers
});
